namespace Agro.Models {
        using System;
        using SN.Data;
        
        
        /// <summary>
        /// 表名：T_Organization 主键列：Organization_ID
        /// </summary>
        [SerializableAttribute()]
        public partial class T_Organization : Entity {
            
            protected Int32 _Organization_ID;
            
            protected String _Organization_Code;
            
            protected String _Organization_Name;
            
            protected Int32 _Organization_ParentID;
            
            protected String _Organization_Type;
            
            protected Int32? _Organization_Order;
            
            protected String _Organization_IsDetail;
            
            protected String _Organization_Remark;
            
            protected String _Organization_Email;
            
            protected String _Organization_Address;
            
            protected String _Organization_Contact;
            
            protected String _Organization_Level;
            
            protected String _Organization_Leisure;
            
            protected String _Organization_CreateUserID;
            
            protected String _Organization_CreateDate;
            
            protected String _Organization_CreateIP;
            
            protected String _Organization_Phone;
            
            /// <summary>
            /// ID
            /// </summary>
            public Int32 Organization_ID {
                get {
                    return this._Organization_ID;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_ID, _Organization_ID, value);
                    this._Organization_ID = value;
                }
            }
            
            /// <summary>
            /// 机构编号
            /// </summary>
            public String Organization_Code {
                get {
                    return this._Organization_Code;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_Code, _Organization_Code, value);
                    this._Organization_Code = value;
                }
            }
            
            /// <summary>
            /// 机构名称
            /// </summary>
            public String Organization_Name {
                get {
                    return this._Organization_Name;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_Name, _Organization_Name, value);
                    this._Organization_Name = value;
                }
            }
            
            /// <summary>
            /// 上级机构ID
            /// </summary>
            public Int32 Organization_ParentID {
                get {
                    return this._Organization_ParentID;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_ParentID, _Organization_ParentID, value);
                    this._Organization_ParentID = value;
                }
            }
            
            /// <summary>
            /// 0 管理部门 1 企业部门
            /// </summary>
            public String Organization_Type {
                get {
                    return this._Organization_Type;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_Type, _Organization_Type, value);
                    this._Organization_Type = value;
                }
            }
            
            /// <summary>
            /// 顺序
            /// </summary>
            public Int32? Organization_Order {
                get {
                    return this._Organization_Order;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_Order, _Organization_Order, value);
                    this._Organization_Order = value;
                }
            }
            
            /// <summary>
            /// 1非明细  0明细
            /// </summary>
            public String Organization_IsDetail {
                get {
                    return this._Organization_IsDetail;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_IsDetail, _Organization_IsDetail, value);
                    this._Organization_IsDetail = value;
                }
            }
            
            /// <summary>
            /// 备注
            /// </summary>
            public String Organization_Remark {
                get {
                    return this._Organization_Remark;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_Remark, _Organization_Remark, value);
                    this._Organization_Remark = value;
                }
            }
            
            /// <summary>
            /// 单位邮箱
            /// </summary>
            public String Organization_Email {
                get {
                    return this._Organization_Email;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_Email, _Organization_Email, value);
                    this._Organization_Email = value;
                }
            }
            
            /// <summary>
            /// 单位地址
            /// </summary>
            public String Organization_Address {
                get {
                    return this._Organization_Address;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_Address, _Organization_Address, value);
                    this._Organization_Address = value;
                }
            }
            
            /// <summary>
            /// 单位联系人
            /// </summary>
            public String Organization_Contact {
                get {
                    return this._Organization_Contact;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_Contact, _Organization_Contact, value);
                    this._Organization_Contact = value;
                }
            }
            
            /// <summary>
            /// 龙头企业级别
            /// </summary>
            public String Organization_Level {
                get {
                    return this._Organization_Level;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_Level, _Organization_Level, value);
                    this._Organization_Level = value;
                }
            }
            
            /// <summary>
            /// 0 非休闲 1 休闲
            /// </summary>
            public String Organization_Leisure {
                get {
                    return this._Organization_Leisure;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_Leisure, _Organization_Leisure, value);
                    this._Organization_Leisure = value;
                }
            }
            
            /// <summary>
            /// 创建人员
            /// </summary>
            public String Organization_CreateUserID {
                get {
                    return this._Organization_CreateUserID;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_CreateUserID, _Organization_CreateUserID, value);
                    this._Organization_CreateUserID = value;
                }
            }
            
            /// <summary>
            /// 创建时间
            /// </summary>
            public String Organization_CreateDate {
                get {
                    return this._Organization_CreateDate;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_CreateDate, _Organization_CreateDate, value);
                    this._Organization_CreateDate = value;
                }
            }
            
            /// <summary>
            /// 创建IP
            /// </summary>
            public String Organization_CreateIP {
                get {
                    return this._Organization_CreateIP;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_CreateIP, _Organization_CreateIP, value);
                    this._Organization_CreateIP = value;
                }
            }
            
            /// <summary>
            /// 电话
            /// </summary>
            public String Organization_Phone {
                get {
                    return this._Organization_Phone;
                }
                set {
                    this.OnPropertyValueChange(_.Organization_Phone, _Organization_Phone, value);
                    this._Organization_Phone = value;
                }
            }
            
            /// <summary>
            /// 获取实体对应的表名
            /// </summary>
            protected override Table GetTable() {
                return new Table<T_Organization>("T_Organization");
            }
            
            /// <summary>
            /// 获取实体中的标识列
            /// </summary>
            protected override Field GetIdentityField() {
                return _.Organization_ID;
            }
            
            /// <summary>
            /// 获取实体中的主键列
            /// </summary>
            protected override Field[] GetPrimaryKeyFields() {
                return new Field[] {
                        _.Organization_ID};
            }
            
            /// <summary>
            /// 获取列信息
            /// </summary>
            protected override Field[] GetFields() {
                return new Field[] {
                        _.Organization_ID,
                        _.Organization_Code,
                        _.Organization_Name,
                        _.Organization_ParentID,
                        _.Organization_Type,
                        _.Organization_Order,
                        _.Organization_IsDetail,
                        _.Organization_Remark,
                        _.Organization_Email,
                        _.Organization_Address,
                        _.Organization_Contact,
                        _.Organization_Level,
                        _.Organization_Leisure,
                        _.Organization_CreateUserID,
                        _.Organization_CreateDate,
                        _.Organization_CreateIP,
                        _.Organization_Phone};
            }
            
            /// <summary>
            /// 获取列数据
            /// </summary>
            protected override object[] GetValues() {
                return new object[] {
                        this._Organization_ID,
                        this._Organization_Code,
                        this._Organization_Name,
                        this._Organization_ParentID,
                        this._Organization_Type,
                        this._Organization_Order,
                        this._Organization_IsDetail,
                        this._Organization_Remark,
                        this._Organization_Email,
                        this._Organization_Address,
                        this._Organization_Contact,
                        this._Organization_Level,
                        this._Organization_Leisure,
                        this._Organization_CreateUserID,
                        this._Organization_CreateDate,
                        this._Organization_CreateIP,
                        this._Organization_Phone};
            }
            
            /// <summary>
            /// 给当前实体赋值
            /// </summary>
            protected override void SetValues(IRowReader reader) {
                if ((false == reader.IsDBNull(_.Organization_ID))) {
                    this._Organization_ID = reader.GetInt32(_.Organization_ID);
                }
                if ((false == reader.IsDBNull(_.Organization_Code))) {
                    this._Organization_Code = reader.GetString(_.Organization_Code);
                }
                if ((false == reader.IsDBNull(_.Organization_Name))) {
                    this._Organization_Name = reader.GetString(_.Organization_Name);
                }
                if ((false == reader.IsDBNull(_.Organization_ParentID))) {
                    this._Organization_ParentID = reader.GetInt32(_.Organization_ParentID);
                }
                if ((false == reader.IsDBNull(_.Organization_Type))) {
                    this._Organization_Type = reader.GetString(_.Organization_Type);
                }
                if ((false == reader.IsDBNull(_.Organization_Order))) {
                    this._Organization_Order = reader.GetInt32(_.Organization_Order);
                }
                if ((false == reader.IsDBNull(_.Organization_IsDetail))) {
                    this._Organization_IsDetail = reader.GetString(_.Organization_IsDetail);
                }
                if ((false == reader.IsDBNull(_.Organization_Remark))) {
                    this._Organization_Remark = reader.GetString(_.Organization_Remark);
                }
                if ((false == reader.IsDBNull(_.Organization_Email))) {
                    this._Organization_Email = reader.GetString(_.Organization_Email);
                }
                if ((false == reader.IsDBNull(_.Organization_Address))) {
                    this._Organization_Address = reader.GetString(_.Organization_Address);
                }
                if ((false == reader.IsDBNull(_.Organization_Contact))) {
                    this._Organization_Contact = reader.GetString(_.Organization_Contact);
                }
                if ((false == reader.IsDBNull(_.Organization_Level))) {
                    this._Organization_Level = reader.GetString(_.Organization_Level);
                }
                if ((false == reader.IsDBNull(_.Organization_Leisure))) {
                    this._Organization_Leisure = reader.GetString(_.Organization_Leisure);
                }
                if ((false == reader.IsDBNull(_.Organization_CreateUserID))) {
                    this._Organization_CreateUserID = reader.GetString(_.Organization_CreateUserID);
                }
                if ((false == reader.IsDBNull(_.Organization_CreateDate))) {
                    this._Organization_CreateDate = reader.GetString(_.Organization_CreateDate);
                }
                if ((false == reader.IsDBNull(_.Organization_CreateIP))) {
                    this._Organization_CreateIP = reader.GetString(_.Organization_CreateIP);
                }
                if ((false == reader.IsDBNull(_.Organization_Phone))) {
                    this._Organization_Phone = reader.GetString(_.Organization_Phone);
                }
            }
            
            public override int GetHashCode() {
                return base.GetHashCode();
            }
            
            public override bool Equals(object obj) {
                if ((obj == null)) {
                    return false;
                }
                if ((false == typeof(T_Organization).IsAssignableFrom(obj.GetType()))) {
                    return false;
                }
                if ((((object)(this)) == ((object)(obj)))) {
                    return true;
                }
                return false;
            }
            
            public class _ {
                
                /// <summary>
                /// 表示选择所有列，与*等同
                /// </summary>
                public static AllField All = new AllField<T_Organization>();
                
                /// <summary>
                /// ID - 字段名：Organization_ID - 数据类型：Int32
                /// </summary>
                public static Field Organization_ID = new Field<T_Organization>("Organization_ID");
                
                /// <summary>
                /// 机构编号 - 字段名：Organization_Code - 数据类型：String
                /// </summary>
                public static Field Organization_Code = new Field<T_Organization>("Organization_Code");
                
                /// <summary>
                /// 机构名称 - 字段名：Organization_Name - 数据类型：String
                /// </summary>
                public static Field Organization_Name = new Field<T_Organization>("Organization_Name");
                
                /// <summary>
                /// 上级机构ID - 字段名：Organization_ParentID - 数据类型：Int32
                /// </summary>
                public static Field Organization_ParentID = new Field<T_Organization>("Organization_ParentID");
                
                /// <summary>
                /// 0 管理部门 1 企业部门 - 字段名：Organization_Type - 数据类型：String
                /// </summary>
                public static Field Organization_Type = new Field<T_Organization>("Organization_Type");
                
                /// <summary>
                /// 顺序 - 字段名：Organization_Order - 数据类型：Nullable`1
                /// </summary>
                public static Field Organization_Order = new Field<T_Organization>("Organization_Order");
                
                /// <summary>
                /// 1非明细  0明细 - 字段名：Organization_IsDetail - 数据类型：String
                /// </summary>
                public static Field Organization_IsDetail = new Field<T_Organization>("Organization_IsDetail");
                
                /// <summary>
                /// 备注 - 字段名：Organization_Remark - 数据类型：String
                /// </summary>
                public static Field Organization_Remark = new Field<T_Organization>("Organization_Remark");
                
                /// <summary>
                /// 单位邮箱 - 字段名：Organization_Email - 数据类型：String
                /// </summary>
                public static Field Organization_Email = new Field<T_Organization>("Organization_Email");
                
                /// <summary>
                /// 单位地址 - 字段名：Organization_Address - 数据类型：String
                /// </summary>
                public static Field Organization_Address = new Field<T_Organization>("Organization_Address");
                
                /// <summary>
                /// 单位联系人 - 字段名：Organization_Contact - 数据类型：String
                /// </summary>
                public static Field Organization_Contact = new Field<T_Organization>("Organization_Contact");
                
                /// <summary>
                /// 龙头企业级别 - 字段名：Organization_Level - 数据类型：String
                /// </summary>
                public static Field Organization_Level = new Field<T_Organization>("Organization_Level");
                
                /// <summary>
                /// 0 非休闲 1 休闲 - 字段名：Organization_Leisure - 数据类型：String
                /// </summary>
                public static Field Organization_Leisure = new Field<T_Organization>("Organization_Leisure");
                
                /// <summary>
                /// 创建人员 - 字段名：Organization_CreateUserID - 数据类型：String
                /// </summary>
                public static Field Organization_CreateUserID = new Field<T_Organization>("Organization_CreateUserID");
                
                /// <summary>
                /// 创建时间 - 字段名：Organization_CreateDate - 数据类型：String
                /// </summary>
                public static Field Organization_CreateDate = new Field<T_Organization>("Organization_CreateDate");
                
                /// <summary>
                /// 创建IP - 字段名：Organization_CreateIP - 数据类型：String
                /// </summary>
                public static Field Organization_CreateIP = new Field<T_Organization>("Organization_CreateIP");
                
                /// <summary>
                /// 电话 - 字段名：Organization_Phone - 数据类型：String
                /// </summary>
                public static Field Organization_Phone = new Field<T_Organization>("Organization_Phone");
            }
        }
    }
    